/**
 *    Copyright 2009 Seth Albnaese
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/** $Id: Player.java 60 2009-06-15 08:47:09Z salbanese0080@gmail.com $ */

package org.aquiferserver.common;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Seth Albanese
 * @version $Id: Player.java 60 2009-06-15 08:47:09Z salbanese0080@gmail.com $
 */
public class Player {
	
	private Integer id;
	private Map<String, String> properties = new HashMap<String, String>();
	
	public Integer getId() { return id; }
	public void setId( Integer id ) { this.id = id; }
	
	public void setProperties( Map<String, String> props ) { this.properties = props; }
	public Map<String, String> getProperties() { return properties; }
	
	public void addProperty( String key, String val )
	{
		properties.put( key, val);
	}
	
	public String fetchProperty( String key )
	{
		return properties.get( key );
	}
	
	@Override
	public boolean equals( Object obj )
	{
		if( !( obj instanceof Player ) ) { return false; }
		
		Player other = ( Player ) obj;
		return other.getId() == id;
	}
}
